# Author: HZT
# Date: 2023/11/8
import time
import page
from base.base import Base
from selenium.webdriver.support.select import Select


class WebCkDf(Base):
    # 获取代付管理元素
    def ck_df_get_dfgl(self):
        return self.base_find(page.web_ck_df_dfgl)

    # 点击代付
    def ck_df_click_df(self):
        self.base_click(page.web_ck_df_df)

    # 点击操作
    def ck_df_click_cz(self):
        self.base_click(page.web_ck_df_cz)

    # 点击申请退款
    def ck_df_click_sqtk(self):
        self.base_click(page.web_ck_df_sqtk)

    # 点击退款提交
    def ck_df_click_tktj(self):
        self.base_click(page.web_ck_df_tktj)

    # 点击操作完成
    def ck_df_click_czwc(self):
        self.base_click(page.web_ck_df_czwc)

    # 点击+代付
    def ck_df_click_jdf(self):
        self.base_click(page.web_ck_df_jdf)

    # 输入银行
    def ck_df_input_yh(self, yh):
        self.base_input(page.web_ck_df_yh, yh)

    # 输入户名
    def ck_df_input_hm(self, hm):
        self.base_input(page.web_ck_df_hm, hm)

    # 输入卡号
    def ck_df_input_kh(self, kh):
        self.base_input(page.web_ck_df_kh, kh)

    # 输入金额（奈拉）
    def ck_df_input_je(self, je):
        self.base_input(page.web_ck_df_je, je)

    # 点击提交
    def ck_df_click_tj(self):
        self.base_click(page.web_ck_df_tj)

    # 发起代付单
    def ck_df(self, yh, hm, kh, je):
        self.ck_df_input_yh(yh)
        self.ck_df_input_hm(hm)
        self.ck_df_input_kh(kh)
        self.ck_df_input_je(je)

    def ck_tksq(self):
        self.ck_df_click_cz()
        time.sleep(1)
        self.ck_df_click_sqtk()
        self.ck_df_click_tktj()
        self.ck_df_click_czwc()
